package com.songlanyun.modules.aboutus.controller.api;

import com.songlanyun.common.utils.R;
import com.songlanyun.modules.aboutus.entity.AboutUsEntity;
import com.songlanyun.modules.aboutus.service.AboutUsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;



/**
 * 关于我们
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-03-30 15:54:03
 */
@RestController
@RequestMapping("api/about/us")
public class AboutUsApiController {
    @Autowired
    private AboutUsService aboutUsService;

    /**
     * 列表
     */
    @GetMapping("/list")
    //@RequiresPermissions("aboutus:aboutus:info")
    public R list(@RequestParam Map<String, Object> params){
        List<AboutUsEntity> list = aboutUsService.appList(params);

        return R.ok().put("list", list);
    }

    /**
     * 详情
     */
    @GetMapping("/info/{id}")
    //@RequiresPermissions("aboutus:aboutus:info")
    public R info(@PathVariable("id") Long id) {
        AboutUsEntity aboutUsEntity = aboutUsService.getById(id);

        return R.ok().put("data", aboutUsEntity);
    }

}
